<template>
  <div>孙组件</div>
  <div>car {{car}}</div>
</template>

<script>
import {inject} from 'vue'
export default {
  name: "Grandson",
  setup() {
    let car=inject('car')
    return{
      car
    }
  },
};
</script>

<style scoped>
div {
  background: #000;
  color: white;
}
</style>